import myRequest, * as request from '@/utils/api.js'
// 获取验证码
export function sendcode(params) {
	// return myRequest('/thirdparty/sms/sendcode', params, 'get');
	return request.post('/thirdparty/sms/sendcode/v1', params);
}
// 密码登录
export function login(params) {
	return request.post('/auth/login/applet', params);
}

export function sendcodelogin(params) {
	return request.post('/auth/sendcode/login/applet', params);
}
export function logout(params) {
	return request.post('/auth/logout', params);
}
export function changePass(params) {
	return request.post('/terminal/terminaluser/amend/info', params);
}
export function getUserUlogin(params = {}) { //获取登录记录
	return request.post('/totallog/loglogin/query/ulogin/record', params);
}
export function getUserVipStatus(params = {}) { // 查看用户vip状态
	return request.get(`/terminal/membe/query/ter/member/detailnew`, params);
}
export function getHomeDetailInfo(params) { //终端个人详情页
	return request.get('/terminal/terminaluser/ter/home/detail');
}
export function postAuthLoginWX(params) { //微信登录
	return request.post('/auth/login/v2/wx', params);
}

// 灵思
export function lsCheckLogin(params, opt) { //灵思一键登录
	return request.post('/auth/scl/oauth1/access_login/enroll_v1', params, opt);
}

export function lsLogin(params, opt) {
	return request.post('/auth/scl/auth/login/applet', params, opt);
}
export function lsSendcodelogin(params, opt) {
	return request.post('/auth/scl/auth/sendcode/login/applet', params, opt);
}
export function lsRegister(data = {}, opt) {
	let formData = new FormData();
	for (const key in data) {
		formData.append(key, data[key]);
	};
	return request.post('/auth/scl/auth/register', formData, opt);
}

export function lsPostAuthLoginWX(params, opt) { //微信登录
	return request.post('/auth/scl/auth/login/v2/wx', params, opt);
}